"use client";
import ArticlePreview from "@/app/components/article-preview/article-preview";
import { List } from "antd";
import React from "react";

export interface ArticleListProps {
  articles: API.Article[];
}

const ArticleList: React.FC<ArticleListProps> = ({ articles }) => {
  return (
    <List
      itemLayout="vertical"
      size="large"
      pagination={{
        pageSize: 10,
      }}
      dataSource={articles}
      renderItem={(item) => {
        return <ArticlePreview article={item} />;
      }}
    />
  );
};

export default ArticleList;
